#include <iostream>
#include <thread>
using namespace std;
void myprint()
{
    cout<< "1线程:" << endl;
    cout<< "2线程:" << endl;
    cout<< "3线程:" << endl;
    cout<< "4线程:" << endl;
    cout<< "5线程:" << endl;
    cout<< "6线程:" << endl;
    cout<< "7线程:" << endl;

}
int main()
{
    thread mytobj(myprint);

    //mytobj.join();

    if(mytobj.joinable())
    {
        mytobj.detach();
    cout<< "joinable = true" << endl;
    }else{
    cout<< "joinable = false" << endl;

    }

    cout<< "1主线程:" << endl;
    cout<< "2主线程:" << endl;
    cout<< "3主线程:" << endl;
    cout<< "4主线程:" << endl;
    cout<< "5主线程:" << endl;
    cout<< "6主线程:" << endl;
    cout<< "7主线程:" << endl;
    return 0;
}
